# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-threadpoolctl
pkgver=2.1.0
pkgrel=0
pkgdesc="Python helpers to limit the number of threads used in native libraries"
url="https://github.com/joblib/threadpoolctl"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
source="https://pypi.python.org/packages/source/t/threadpoolctl/threadpoolctl-$pkgver.tar.gz"
builddir="$srcdir/threadpoolctl-$pkgver"

build() {
	python3 setup.py build
}

check() {
	# HACK so calls to "python" will get what we want
	ln -s /usr/bin/python3 python
	export PATH="$(pwd):$PATH"
	pytest
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="ad2a514fd4e37f6f9127d2eebfa99a4e2cc5d709c7faa8ce75940772c1034772d774b76caa9359ee01a2aa29748458b9475c49f2b2ae91147f5c9b34054b771c  threadpoolctl-2.1.0.tar.gz"
